Skip to content

feat(docs): add a Postgres Triggers guide eval - #556

Draft
czenko wants to merge 1 commit into
mainfrom
docs/triggers-guide-eval
Draft

czenko wants to merge 1 commit into
mainfrom
docs/triggers-guide-eval

Conversation

@czenko

@czenko czenko commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes DOCS-1660

Problem

Nothing measures whether the Postgres Triggers guide leads an agent to a trigger that works for app users. A trigger function runs with the rights of whoever made the change. An agent writes one that works when tested as the database owner. Then a signed-in user's update fails with 42501, or the agent opens the target table to make it pass.

Evidence:

The ticket's draft claim, "a trigger fires on the right event", survives as two checks: firing once per row in a bulk update, and not firing on a save that leaves the status unchanged. The evidence points at the privilege failure, so that is the main claim.

Only benchmark/build-auth-001 seeds a trigger, and no eval tests trigger privileges, firing level or unchanged updates.

Sources reached: Linear, Slack, agent-skills issues, supabase/supabase issues, troubleshooting guides. Not reached: Hex, Supacademy.

Changes

Adds build-docs-035-postgres-triggers. An order page needs a status timeline, filled in automatically whoever changes the status. Customers can read their own timeline but never write it. The seed has the timeline table with row level security on and no write policy, and ORDERS.md fixes how the app saves orders.

Checks:

  • The agent applied the migrations it wrote.
  • A status change from the back office is recorded on the timeline.
  • A status change by a signed-in customer is recorded on the timeline.
  • Cancelling several orders at once records one entry per order.
  • Saving an order without changing its status adds no entry.
  • Customers see the timeline of their own orders only.
  • Customers cannot add, change or remove timeline entries.
  • The agent read the Postgres Triggers guide.

Expected signal: The guide does not cover who a trigger runs as, security definer, WHEN, or UPDATE OF. A trigger written from the page alone fails the customer, bulk and unchanged checks on 42501.

What part of the guide this tests:

Guide section Tested How
Creating a trigger, trigger functions Yes Every behavioral probe
Trigger variables OLD and NEW Yes Entries must carry the right old and new status
BEFORE and AFTER Partly A BEFORE trigger that returns null fails, because the change does not land
Execution frequency, row and statement Yes The bulk check. A statement trigger with transition tables passes
TG_* variables, dropping a trigger, restricted schemas No Not part of the task

Verification

  • pnpm exec biome check evals/docs/build-docs-035-postgres-triggers passes.
  • pnpm --filter @supabase-evals/framework typecheck passes.
  • pnpm eval:dry -- --suite docs --eval build-docs-035-postgres-triggers plans one pair on codex-gpt-6-luna-no-skills.
  • Baseline: three runs of codex-gpt-6-luna-no-skills in the run-evals-changed run. All three passed all eight checks, including the guide read. A full-marks pass does not show the page carried the run, since a model that knows the security definer pattern produces the same result. Braintrust run.

For new or changed evals (see Submitting evals for review):

  • Ran the eval locally, and it completes without framework errors.
  • Ran it in CI with the run-evals-changed label or the Refresh eval results workflow (suite: regression for framework changes), and linked the Braintrust run here.

@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Nov 25, 2026 7:46pm UTC

Request Review

@czenko czenko added the run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes label Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant